package cloud.dandanit.itservice.controller.message;


import cloud.dandanit.itservice.service.MsgService;
import cloud.dandanit.itservice.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author luokai
 */
@Api("短信管理")
//@CrossOrigin
@RestController
@RequestMapping("/itservice/msg")
@SuppressWarnings("AlibabaCommentsMustBeJavadocFormat")
public class MsgController {

    @Autowired
    private MsgService msgService;

    //发送短信的方法
    @GetMapping("send/{phone}")
    @ApiOperation("获取短信验证码接口")
    public R sendMsm(
            @ApiParam(name = "phone", value = "手机号", required = true)
            @PathVariable String phone) {

        String code = msgService.sendTencentMsg(phone);
        return R.ok().data("code", code);
    }
}
